package com.crm.service.activity.controller;

import com.crm.model.activity.dtos.ActivityDto;
import com.crm.model.activity.dtos.PageActivityDto;
import com.crm.model.common.dtos.ResponseResult;
import com.crm.service.activity.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/activity")
public class ActivityController {

    @Autowired
    private ActivityService activityService;

    @GetMapping("/list")
    public ResponseResult findActivityIdOrChannelOrCreatedTimeOrEndTime(PageActivityDto dto){
        return activityService.findActivityIdOrChannelOrCreatedTimeOrEndTime(dto);
    }

    @PostMapping("/save")
    public ResponseResult addActivity(@RequestBody ActivityDto dto){
      return activityService.addActivity(dto);
    }
}
